<div id="content">
	<div class="row s_page_title" *ngIf="pageType ==='new'">
		<sa-big-breadcrumbs [items]="['系统基础管理','用户管理','新增用户']" icon="fa fa-list" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<div class="row s_page_title" *ngIf="pageType ==='updata'">
		<sa-big-breadcrumbs [items]="['系统基础管理','用户管理','编辑用户']" icon="fa fa-list" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<div class="s_page_wrap">
		<div class="page-header">
			<h1 class="page_detail_title">{{page_title}}用户</h1>
		</div>
		<div class="row" style="margin-top:5px;">
		<div class="col-xs-12">
				<!-- (ngSubmit)="onSubmit()" -->
			<form id="userForm" name="userForm" class="form-horizontal" role="form" novalidate="novalidate" [saBootstrapValidator]="validatorOptions">

				<div class="form-group">
					<label class="control-label col-sm-1 no-padding-right">账户名<sup>*</sup></label>
					<div class="col-sm-10">
						<div class="clearfix">
							<input class="form-control" disabled *ngIf='page_title === "编辑"' [(ngModel)]='page.userName' name="userName" type="text"  placeholder="将做为用户登录系统的账户(英文)..." />
							<input class="form-control" *ngIf='page_title === "新增"' [(ngModel)]='page.userName' name="userName" type="text" placeholder="将做为用户登录系统的账户(英文)..." autocomplete='username'/>
						</div>
					</div>
				</div>

				<div class="form-group" *ngIf='page_title === "新增"'>
					<label class="control-label col-sm-1 no-padding-right">密码<sup>*</sup></label>
					<div class="col-sm-10">
						<div class="clearfix">
							<input class="form-control" name="password" [(ngModel)]='page.password' type="password" placeholder="密码..." autocomplete="new-password"/>
						</div>
					</div>
				</div>

				<div class="form-group" *ngIf='page_title === "新增"'>
					<label class="control-label col-sm-1 no-padding-right" >确认密码<sup>*</sup></label>
					<div class="col-sm-10">
						<div class="clearfix">
							<input class="form-control" name="repassword" [(ngModel)]='page.repassword' type="password" placeholder="确认密码..." autocomplete="new-password"/>
						</div>
					</div>
				</div>
				<!--</c:if>-->
				<div class="form-group">
					<label class="control-label col-sm-1 no-padding-right">真实姓名<sup>*</sup></label>
					<div class="col-sm-10">
						<div class="clearfix">
							<input class="form-control" name="name" type="text" [(ngModel)]='page.name' placeholder="真实姓名..." autocomplete='name'/>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label col-sm-1 no-padding-right">用户类型<sup>*</sup></label>
					<div class="col-sm-10">
						<div class="clearfix">
							<select class="form-control" name="userType" [(ngModel)]="page.userType" (change)="typeChange($event.target.value)" style="width: 100%">
								<option value="" selected>请选择</option>
								<option *ngFor="let item of userTypeList" [value]='item.id'>{{item.text}}</option>
							</select>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label col-sm-1 no-padding-right">所属角色<sup>*</sup></label>
					<div class="col-sm-10">
						<div class="clearfix s_fix_select2">
							<select class="form-control select2" id="roleSelect2" name="roleId" style="width: 100%">
								<option value=''></option>
							</select>
						</div>
					</div>
				</div>

				<div class="form-group">
					<label class="control-label col-sm-1 no-padding-right">单位名称</label>
					<div class="col-sm-10">
						<div class="clearfix">
							<input class="form-control" name="companyName" type="text" [(ngModel)]='page.companyName' placeholder="单位名称..." autocomplete='organization'/>
						</div>
					</div>
				</div>

				<div class="form-group">
					<label class="control-label col-sm-1 no-padding-right">用户描述</label>
					<div class="col-sm-10">
						<div class="clearfix">
							<input class="form-control" [(ngModel)]='page.description' name="description" id="description" type="text" placeholder="用户描述..." />
						</div>
					</div>
				</div>

				<!-- 新需求 -->
				<div class="form-group">
					<label class="control-label col-sm-1 no-padding-right">电话号码</label>
					<div class="col-sm-10">
						<div class="clearfix">
							<input class="form-control" name="phone" type="text" [(ngModel)]='page.phone' placeholder="电话号码..." autocomplete='tel-national'/>
						</div>
					</div>
				</div>

				<div class="form-group">
					<label class="control-label col-sm-1 no-padding-right">邮箱</label>
					<div class="col-sm-10">
						<div class="clearfix">
							<input class="form-control" name="email" type="text" [(ngModel)]='page.email' placeholder="邮箱..." autocomplete="email"/>
						</div>
					</div>
				</div>

				<div class="form-group">
					<label class="control-label col-sm-1 no-padding-right">服务到期日期</label>
					<div class="col-sm-10">
						<div class=" clearfix" >
							<input class="form-control" name="serviceEndTime" autocomplete="off" [(ngModel)]='page.serviceEndTime' id="serviceEndTime" placeholder="服务到期日期..." />
						</div>
					</div>
				</div>

				<div class="form-group clearfix">
					<label class="control-label col-sm-1 no-padding-right">绑定公司[接口专用]</label>
					<div class="col-sm-10">
						<sa-company-tree companyTreeId="companyTree" [Height]="32" placeholder="用于API接口识别" [companyNameValue]="selectedCompanyName" [companyIdValue]="selectedCompanyId" (companySelected)="companySelected($event)"></sa-company-tree>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label col-sm-1 no-padding-right">实施团队</label>
					<div class="col-sm-10 s_hover_box">
						<div class="clearfix s_fix_select2">
							<select class="form-control select2" id="teamSelect2" name="outsourcingTeamName" style="width: 100%">
								<option value=''></option>
							</select>
							<div class="s_del_icon" style="right:17px;top:9px;" (click)='delTeamSelect()'>x</div>
						</div>
					</div>
				</div>

				<div class="form-group">
					<label class="control-label col-sm-1 no-padding-right">员工类型<sup>*</sup></label>
					<div class="col-sm-10">
						<div class="clearfix">
							<select class="form-control" name="workerType" [(ngModel)]="page.workerType" style="width: 100%">
								<option value="" selected>请选择</option>
								<option value="0">管理者</option>
								<option value="1">正式员工</option>
								<option value="2">兼职员工</option>
								<option value="3">外包员工</option>
							</select>
						</div>
					</div>
				</div>
				<div class="form-group" [hidden]="isShowTeam">
					<label class="control-label col-sm-1 no-padding-right" for="role.id">在职状态<sup>*</sup></label>
					<div class="col-sm-10">
						<div class="clearfix">
							<select class="form-control" name="workerState" style="width: 100%" [(ngModel)]='page.workerState'>
								<option value="" selected>请选择</option>
								<option value='1'>在职</option>
								<option value='0'>离职</option>
							</select>
						</div>
					</div>
				</div>

				<div class="form-group clearfix">
					<label class="control-label col-sm-1 no-padding-right" for="imgFile">头像</label>
					<div class="col-sm-10">
						<button  type="button"  class="btn imgFile">{{imgFileTitle}}
							<input type="file" class="up" title=" " placeholder=" " (change)="fileChange($event.target.files)"/>
							<div class="headImg" >
						      	<img id="img0" class="img"  [src]="page.headPortraitPath" *ngIf="page.headPortraitPath">
						    </div>
						</button>
					</div>
				</div>

				<div class="center">
					<button class="btn btn-primary" *ngIf='page_title === "新增"' (click)='onSubmit()'>添加</button>
					<button class="btn btn-primary" *ngIf='page_title === "编辑"' (click)='onSubmit()'>保存</button>
					<button type="button" (click)='goBack()' class="btn default">返回</button>
				</div>
			</form>
			<div class="hr hr-dotted"></div>
		</div>
	</div>
	</div>
</div>